<template>
	<div class="canshu flex ">
    <left2></left2>
    <div style="width: calc(100vw - 200px); height: 100vh; overflow: auto;">
      <div style="padding: 30px; ">
        <el-tabs v-model="activeName" type="card">
            <el-tab-pane label="轴承库管理" name="first">
              <zhouchengku ref="zhouchengku"></zhouchengku>
            </el-tab-pane>
            <el-tab-pane label="轴管理" name="second">
              <zhouguanli ref="zhouguanli"></zhouguanli>
            </el-tab-pane>
          </el-tabs>
        </div>
      </div>
	</div>
</template>

<script>


  import moment from "moment"
  import left2 from '../left2.vue'
  import zhouchengku from './zhouchengku.vue'
  import zhouguanli from './zhouguanli.vue'
	export default {
		name: 'zuzhiguanli',
    components:{
      left2,zhouchengku,zhouguanli
    },
		data() {
			return {
        loading:true,
        activeName: 'first',
        all:{

        },
        xialaall:{},

        all2:{

        }
			}
		},
		created() {

      // if(this.$store.state.one){
      //   this.loading = true
      // }else{
      //   this.loading = false
      // }

      // var setv = setInterval(()=>{
      //   let obj11 = {
      //     sysName:"参数设置",
      //     dictName:"通用设置-数据压缩",
      //     dictType:""
      //   }
      //   postxiala(obj11).then(response => {
      //     this.xialaall.shujuyasuolist = response.data
      //     clearInterval(setv)
      //     this.loading = false
      //     this.$store.commit('changeone',false)

      //     Promise.all([this.getxialalist(),this.getxialalist1(),this.getxialalist2(),this.getxialalist3(),this.getxialalist4(),this.getxialalist5(),this.getxialalist6(),this.getxialalist7(),this.getxialalist8(),this.getxialalist9(),this.getxialalist10()]).then(()=>{
      //       getgeneral().then(response => {
      //         this.all2 = response.data
      //       })
      //       getsenior().then(response => {
      //         this.all = response.data
      //         this.all.startTime = moment(this.all.startTime, "HH:mm")
      //       })
      //     })
      //   })
      // },1000)





		},
		mounted() {

		},
		methods: {
      baocun:function(){
        let obj = JSON.parse(JSON.stringify(this.all))
        obj.startTime = moment(obj.startTime).format("HH:mm")
        postsenior(obj).then(response => {
          this.$message.success('保存成功');
        })
      },
      baocun2:function(){
        postgeneral(this.all2).then(response => {
          this.$message.success('保存成功');
        })
      },

      getxialalist1:function(){
        return new Promise((res,rej)=>{
          let obj = {
            sysName:"参数设置",
            dictName:"高级设置-位移信号数据来源",
            dictType:""
          }

          postxiala(obj).then(response => {
            this.xialaall.xinhaolaiyuanlist = response.data
          })
          res()
        })
      },
      getxialalist2:function(){
        return new Promise((res,rej)=>{
          let obj2 = {
            sysName:"参数设置",
            dictName:"高级设置-速度信号附加长度",
            dictType:""
          }
          postxiala(obj2).then(response => {
            this.xialaall.xinhaochangdulist = response.data
          })
          res()
        })
      },
      getxialalist3:function(){
        return new Promise((res,rej)=>{
          let obj3 = {
            sysName:"参数设置",
            dictName:"高级设置-信号类型",
            dictType:""
          }
          postxiala(obj3).then(response => {
            this.xialaall.xinhaoleixinglist = response.data
          })
          res()
        })
      },
      getxialalist4:function(){
        return new Promise((res,rej)=>{
          let obj4 = {
            sysName:"参数设置",
            dictName:"高级设置-分析频率",
            dictType:""
          }
          postxiala(obj4).then(response => {
            this.xialaall.fenxipinlvlist = response.data
          })
          res()
        })
      },
      getxialalist5:function(){
        return new Promise((res,rej)=>{
          let obj5 = {
            sysName:"参数设置",
            dictName:"高级设置-数据长度",
            dictType:""
          }
          postxiala(obj5).then(response => {
            this.xialaall.shujuchangdulist = response.data
          })
          res()
        })
      },
      getxialalist6:function(){
        return new Promise((res,rej)=>{
          let obj6 = {
            sysName:"参数设置",
            dictName:"通用设置-报警器",
            dictType:""
          }
          postxiala(obj6).then(response => {
            this.xialaall.baojingqilist = response.data
          })
          res()
        })
      },
      getxialalist7:function(){
        return new Promise((res,rej)=>{
          let obj7 = {
            sysName:"参数设置",
            dictName:"通用设置-通讯端口",
            dictType:""
          }
          postxiala(obj7).then(response => {
            this.xialaall.tongxinduankoulist = response.data
          })
          res()
        })
      },
      getxialalist8:function(){
        return new Promise((res,rej)=>{
          let obj8 = {
            sysName:"参数设置",
            dictName:"通用设置-波特率",
            dictType:""
          }
          postxiala(obj8).then(response => {
            this.xialaall.botelvlist = response.data
          })
          res()
        })
      },
      getxialalist9:function(){
        return new Promise((res,rej)=>{
          let obj9 = {
            sysName:"参数设置",
            dictName:"通用设置-奇偶校验",
            dictType:""
          }
          postxiala(obj9).then(response => {
            this.xialaall.jioujiaoyanlist = response.data
          })
          res()
        })
      },
      getxialalist10:function(){
        return new Promise((res,rej)=>{
          let obj10 = {
            sysName:"参数设置",
            dictName:"通用设置-停止位",
            dictType:""
          }
          postxiala(obj10).then(response => {
            this.xialaall.tingzhiweilist = response.data
          })

          res()
        })
      },

      //获取下啦数据用
      getxialalist:function(){
        let obj11 = {
          sysName:"参数设置",
          dictName:"通用设置-数据压缩",
          dictType:""
        }
        postxiala(obj11).then(response => {
          this.xialaall.shujuyasuolist = response.data
        })

      },
		}
	}
</script>


<style scoped lang="less">
  .canshu{
    /deep/ .el-tabs__header{ margin: 0;}
    /deep/ .el-tabs__content{ background: #fff;}
    /deep/ .el-tabs__item.is-active{ background: #fff;}
  }
</style>
